export const TEXT = 'text';
export const SELECT = "select";
export const PASSWORD = "password";
export const TEXTAREA = "textarea";
export const READIO = "radio";
export const DATA_PICKER = "datapicker";

export const identOptions = [
    { label: '普通管理员', value: 0 },
    { label: '超级管理员', value: 1 }
]

export const validatePhone = (rule, value, callback) => {
    let reg = /^1[3456789]{1}\d{9}$/
    if (value === "") {
        callback(new Error("请输入手机号"));
    } else if (!reg.test(value)) {
        callback(new Error("手机号格式不正确！"));
    } else {
        callback();
    }
};
export const validateEmail = (rule, value, callback) => {
    let reg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
    if (value === "") {
        callback(new Error("请输入邮箱"));
    } else if (!reg.test(value)) {
        callback(new Error("邮箱格式不正确！！"));
    } else {
        callback();
    }
}
export const validatorCheckpass = function (rule, value, callback) {
    if (value === '') {
        callback(new Error('请再次输入密码'));
    } else if (value !== this.formData.password) {
        callback(new Error('两次输入密码不一致!'));
    } else {
        callback();
    }
}